
import threading
import time


class Mythreading(threading.Thread):

    def __init__(self, n):
        super(Mythreading, self).__init__()
        self.n = n

    def run(self):
        print('类的线程：', self.n)
        time.sleep(2)

t1 = Mythreading('t1')
t2 = Mythreading('t2')

t1.start()
t1.join()  # == wait()只是在python里面不一样，等待t1线程结束后再往下走
t2.start()